<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/fmt.tld" prefix="fmt" %>
<!DOCTYPE html>
<html lang="zh-CN" >
<head>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>额度管理详情</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body class="iframeBody">
<div class="Wrapper">
<div class="Wrapper">
	<div id="pageInTab" class="pageInTab">
		<div tabid="tabA" title="基本信息" lselected="true">
            <form id="formSet1">
            	<div class="fieldset1 tabel_col clearFix">
            		<div class="caption">
                        <span class="title">基础信息</span>
                    </div>
                    <div class="fieldBox col_33">
	                    <div class="label">事业部</div>
	                    <div class="field">
	                    	<span name="buOrgCdNm" id="buOrgCdNm">${quatoBscInfoVO.buOrgCdNm}</span>
	                    	<input name="id" id="id" type="hidden" value="${id }">
	                    </div>
	                </div>
					<div class="fieldBox col_50">
						<div class="label">项目类型</div>
						<div class="field">
							<span name="prjTypCdNm" id="prjTypCdNm">${quatoBscInfoVO.prjTypCdNm}</span>
						</div>
					</div>
                    <div class="fieldBox col_33">
	                    <div class="label">剩余可用额度(万)</div>
	                    <div class="field">
	                    	<span name="remainQuato" id="remainQuato"><fmt:formatNumber value='${quatoBscInfoVO.remainQuato}' pattern='0.0000' /></span>
	                    </div>
	                </div>
                    <div class="fieldBox col_50">
	                    <div class="label">风控审核通过额度(万)</div>
	                    <div class="field">
	                    	<span name="auditPassQuato" id="auditPassQuato"><fmt:formatNumber value='${quatoBscInfoVO.auditPassQuato}' pattern='0.0000' /></span>
	                    </div>
	                </div>
					<div class="fieldBox col_33">
						<div class="label">已放款额度(万)</div>
						<div class="field">
							<span name="loanQuato" id="loanQuato"><fmt:formatNumber value='${quatoBscInfoVO.loanQuato}' pattern='0.0000' /></span>
						</div>
					</div>
            	</div>
            	<div class="sqPanel">
	                <div class="sqPanel_head inL">
	                    <span>额度变更记录</span>
	                </div>
	                <div class="sqPanel_body">
	                    <div id="ligergrid_A1" class="sq-grid"></div>
	                </div>
	            </div>
				<div class="sqPanel">
					<div class="sqPanel_head inL">
						<span>修改记录</span>
					</div>
					<div class="sqPanel_body">
						<div id="ligergrid_A2" class="sq-grid"></div>
					</div>
				</div>
                
            </form>
        </div>
	</div>
</div>
</div>


<script type="text/javascript">
var quatoChangeHistory ;
var quatoPrjTypCdChangeHistory ;

$(function () {
	initQuatoExtraInfoGrid();
});



//初始化额度变更历史列表
function initQuatoExtraInfoGrid() {
    var id = $("#id").val();
    if(!id){
        return; //验证不通过，不执行以下代码
    }
	//格式化时间
	function renderDate(rowdata, index, value){
		var dateStr = "";
		if(null != value){
			var date = new Date(value);
			dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DDHHMMSS);
		}
		return dateStr;
	}

	$("#ligergrid_A1").ligerGrid({
        usePager: false,
        url: '<%=path%>/quato/quatoBscInfo/getQuatoChangeHistory.do?id=' +id,
        method : 'get',
        columns: [
            { display: '变更类型', name: 'changeType', minWidth: 100,
				render: function(rowdata, rowindex, value){
					if(rowdata.changeType == 1){
						return "新增" ;
					}else if(rowdata.changeType == 2){
						return "追加";
					}else if(rowdata.changeType == 3){
						return "扣减";
					}else{
						return "";
					}
				}
			},
            { display: '额度(万)', name: 'changeAmount', minWidth: 140},
            { display: '备注', name: 'remark', minWidth: 140},
            { display: '修改时间', name: 'updateTime', minWidth: 140, render:renderDate},
            { display: '修改人', name: 'crtUsrName', minWidth: 140},

        ],
        pageSize:10,
        root:'rows',
        record:'total',
        hideLoadButton : true,
        width: '100%',
        isScroll: false,
        //checkbox:true,
        rownumbers:true,
        onAfterShowData: function() {
            SetIframe_height ();
        }
    });

	 $("#ligergrid_A2").ligerGrid({
		usePager: false,
		url: '<%=path%>/quato/quatoBscInfo/getQuatoPrjTypCdChangeHistory.do?id=' +id,
		method : 'get',
		columns: [
			{ display: '修改前事业部', name: 'beforeBuOrgCdNames', minWidth: 140},
			{ display: '修改后事业部', name: 'afterBuOrgCdNames', minWidth: 140},
			{ display: '修改前项目类型', name: 'beforeTypCdNames', minWidth: 140},
			{ display: '修改后项目类型', name: 'afterTypCdNames', minWidth: 140},
			{ display: '备注', name: 'remark', minWidth: 140},
			{ display: '修改时间', name: 'updateTime', minWidth: 140, render:renderDate},
			{ display: '修改人', name: 'crtUsrName', minWidth: 140},

		],
		pageSize:10,
		root:'rows',
		record:'total',
		hideLoadButton : true,
		width: '100%',
		isScroll: false,
		//checkbox:true,
		rownumbers:true,
		onAfterShowData: function() {
			SetIframe_height ();
		}
	});
	quatoChangeHistory = liger.get("ligergrid_A1");
	quatoPrjTypCdChangeHistory = liger.get("ligergrid_A2");
};




</script>



</body>
</html>
